<?php

 if (! defined('BASEPATH')) exit('No direct script access');
class Registro extends Controller {
	//php 5 constructor
	function __construct() {
		parent::Controller();
		$this->load->helper('url');
                $this->load->helper('form');
                $this->load->library('validation');
                $this->load->model('musuario');
                $this->load->model('mcombos');

	}
	function index() {
		$data=array();
		$this->load->view('registroAlumno',$data);
	}
        function registroAlumno(){
                $data=array();

                $opcion=$this->mcombos->getGrado();

                $data['grados']=$opcion;

		$this->load->view('registroAlumno',$data);
                //$this->load->view('ajaxSubmit-intergration-demo',$data);


        }
        function registroDocente(){
                $data=array();

                $opcion=$this->mcombos->getGrado();

                $data['grados']=$opcion;

		$this->load->view('registroDocente',$data);
        }
        function registroAdministrativo(){
                $data=array();

                $opcion=$this->mcombos->getGrado();

                $data['grados']=$opcion;

		$this->load->view('registroAdministrativo',$data);
        }

        function valida(){
               
                $data['apellidoPat']=$_REQUEST['apellidoPaterno'];
                $data['apellidoMat']=$_REQUEST['apellidoMaterno'];
                $data['nombre']=$_REQUEST['nombres'];
                $data['email']=$_REQUEST['email'];
                $data['clave']=md5($_REQUEST['clave']);
                $data['idestado']=1;
                $data['idpreguntaSecreta']=1;
                $data['idperfil']=1;
                
                $num=$this->musuario->existCorreo($data['email']);
                if($num==0){
                $this->musuario->insertaUsuario($data);
                }
                print_r($num);


        }
}

?>
